﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using SERP.StringMappings;
using SERP.DAO;
using SERP.Controllers;
namespace SERP.Modules.SalaryFields{
	public partial class SalaryFieldsInputFields : SERP.Modules.ModuleBase
	{
		protected void Page_Load(object sender, EventArgs e){
			LoadLanguage();
		}
		private SalaryFieldsEntity model=new SalaryFieldsEntity();
		public SalaryFieldsEntity Model{
			set{
				model=value;
			}
			get{
				return model;
			}
		}
		//Load All lable text
		private void LoadLanguage(){
			labelFieldCode.Text=SalaryFieldsStringMapping.FieldCode+":";
			labelFieldName.Text=SalaryFieldsStringMapping.FieldName+":";
			labelFieldNote.Text=SalaryFieldsStringMapping.FieldNote+":";
			labelFieldType.Text=SalaryFieldsStringMapping.FieldType+":";
			validRQFieldType.ErrorMessage=SERP.Constants.APP_REQUIRE_WARNING;	
			validExpressionFieldType.ErrorMessage=SERP.Constants.APP_REQUIRE_INTERGER_WARNING;
		}   
		public void UpdateToModel(){
			model.FieldCode=Convert.ToString(txtFieldCode.Text);
			model.FieldName=Convert.ToString(txtFieldName.Text);
			model.FieldNote=Convert.ToString(txtFieldNote.Text);
			model.FieldType=Convert.ToByte(txtFieldType.Text);
		}
		public void UpdateToScreen(){
			txtFieldCode.Text=model.FieldCode;
			txtFieldName.Text=model.FieldName;
			txtFieldNote.Text=model.FieldNote;
			txtFieldType.Text=Convert.ToString(model.FieldType);
		}
		public void ClearScreen(){
			txtFieldCode.Text="";
			txtFieldName.Text="";
			txtFieldNote.Text="";
			txtFieldType.Text="0";
		}
		public bool ValidateScreen(){
			bool result=true;
			return result;
		}	
	}
}
